<?php
echo $header;
echo $column_left;
echo $column_right;
$width_content = '100%';
if (($column_left) && ($column_right)) {
    $width_content = '48%';
} elseif (($column_left) || ($column_right)) {
    $width_content = '74%';
}
$style = '';
if ($column_left) {
    $style .= '; margin-left:1%';
}
if ($column_right) {
    $style .= '; margin-right:1%';
}
?>
<div class="content" style="width:<?php echo $width_content . $style; ?>"><?php echo $content_top; ?>
    <div class="breadcrumb">
        <?php foreach ($breadcrumbs as $breadcrumb) { ?>
            <?php echo $breadcrumb['separator']; ?><a href="<?php echo $breadcrumb['href']; ?>"><?php echo $breadcrumb['text']; ?></a>
        <?php } ?>
    </div>
    <ul data-role="listview" data-divider-theme="a">
        <li data-role="list-divider"><h1><?php echo $heading_title; ?></h1></li>
    </ul><br />
    <?php if ($error_warning) { ?>
        <div class="warning"><?php echo $error_warning; ?></div>
    <?php } ?>
    <?php echo $text_description; ?>
    <form action="<?php echo $action; ?>" method="post" enctype="multipart/form-data" id="return">
        <div class="form">
            <div data-role="fieldcontain">
                <ul data-role="listview" data-divider-theme="a">
                    <li data-role="list-divider"><?php echo $text_order; ?></li>
                    <li>
                        <input class="large-field" placeholder="<?php echo $entry_firstname; ?>" type="text" name="firstname" value="<?php echo $firstname; ?>" /><span class="required">*</span>
                        <?php if ($error_firstname) { ?>
                            <div class="error"><?php echo $error_firstname; ?></div>
                        <?php } ?>
                    </li>
                    <li>
                        <input class="large-field" placeholder="<?php echo $entry_lastname; ?>" type="text" name="lastname" value="<?php echo $lastname; ?>" /><span class="required">*</span>
                        <?php if ($error_lastname) { ?>
                            <div class="error"><?php echo $error_lastname; ?></div>
                        <?php } ?>
                    </li>
                    <li>
                        <input class="large-field" placeholder="<?php echo $entry_email; ?>" type="text" name="email" value="<?php echo $email; ?>" /><span class="required">*</span>
                        <?php if ($error_email) { ?>
                            <div class="error"><?php echo $error_email; ?></div>
                        <?php } ?>
                    </li>
                    <li>
                        <input class="large-field" placeholder="<?php echo $entry_telephone; ?>" type="text" name="telephone" value="<?php echo $telephone; ?>" /><span class="required">*</span>
                        <?php if ($error_telephone) { ?>
                            <div class="error"><?php echo $error_telephone; ?></div>
                        <?php } ?>
                    </li>
                    <li>
                        <input class="large-field" placeholder="<?php echo $entry_order_id; ?>" type="text" name="order_id" value="<?php echo $order_id; ?>" /><span class="required">*</span>
                        <?php if ($error_order_id) { ?>
                            <div class="error"><?php echo $error_order_id; ?></div>
                        <?php } ?>
                    </li>
                    <li>
                        <input class="large-field" placeholder="<?php echo $entry_date_ordered; ?>" type="text" name="date_ordered" value="<?php echo $date_ordered; ?>" />
                    </li>
                </ul>
            </div>
            <div data-role="fieldcontain" id="return-product">
                <ul data-role="listview" data-divider-theme="a">
                    <li data-role="list-divider"><?php echo $text_product; ?></li>
                </ul>
                <ul data-role="listview" data-divider-theme="a">
                    <li>
                        <div data-role="collapsible" data-collapsed="false" data-content-theme="a">
                            <h3>&nbsp;</h3>
                            <div class="return-product">
                                <div class="return-name">
                                    <input placeholder="<?php echo $entry_product; ?>" type="text" name="product" value="<?php echo $product; ?>" /><span class="required">*</span>
                                    <?php if ($error_product) { ?>
                                        <div class="error"><?php echo $error_product; ?></div>
                                    <?php } ?>
                                </div>
                                <div class="return-model">
                                    <input placeholder="<?php echo $entry_model; ?>" type="text" name="model" value="<?php echo $model; ?>" /><span class="required">*</span>
                                    <?php if ($error_model) { ?>
                                        <div class="error"><?php echo $error_model; ?></div>
                                    <?php } ?>
                                </div>
                                <div class="return-quantity">
                                    <input placeholder="<?php echo $entry_quantity; ?>" type="text" name="quantity" value="<?php echo $quantity; ?>" />
                                </div>
                            </div>
                            <div class="return-detail">
                                <div class="return-reason">
                                    <fieldset data-role="controlgroup">
                                        <legend><span class="required">*</span> <?php echo $entry_reason; ?></legend>
                                        <?php foreach ($return_reasons as $return_reason) { ?>
                                            <?php if ($return_reason['return_reason_id'] == $return_reason_id) { ?>
                                                <input type="radio" name="return_reason_id" value="<?php echo $return_reason['return_reason_id']; ?>" id="return-reason-id<?php echo $return_reason['return_reason_id']; ?>" checked="checked" />
                                                <label for="return-reason-id<?php echo $return_reason['return_reason_id']; ?>"><?php echo $return_reason['name']; ?></label>
                                            <?php } else { ?>
                                                <input type="radio" name="return_reason_id" value="<?php echo $return_reason['return_reason_id']; ?>" id="return-reason-id<?php echo $return_reason['return_reason_id']; ?>" />
                                                <label for="return-reason-id<?php echo $return_reason['return_reason_id']; ?>"><?php echo $return_reason['name']; ?></label>
                                            <?php } ?>
                                        <?php } ?>
                                    </fieldset>
                                    <?php if ($error_reason) { ?>
                                        <div class="error"><?php echo $error_reason; ?></div>
                                    <?php } ?>
                                </div>
                                <div class="return-opened">
                                    <fieldset data-role="controlgroup">
                                        <legend><span class="required">*</span> <?php echo $entry_opened; ?></legend>
                                        <?php if ($opened) { ?>
                                            <input type="radio" name="opened" value="1" id="opened" checked="checked" />
                                        <?php } else { ?>
                                            <input type="radio" name="opened" value="1" id="opened" />
                                        <?php } ?>
                                        <label for="opened"><?php echo $text_yes; ?></label>
                                        <?php if (!$opened) { ?>
                                            <input type="radio" name="opened" value="0" id="unopened" checked="checked" />
                                        <?php } else { ?>
                                            <input type="radio" name="opened" value="0" id="unopened" />
                                        <?php } ?>
                                        <label for="unopened"><?php echo $text_no; ?></label>
                                    </fieldset>
                                    <br />
                                    <label for="comment"><?php echo $entry_fault_detail; ?></label>
                                    <textarea name="comment" id="comment" cols="150" rows="6"><?php echo $comment; ?></textarea>
                                </div>
                                <div class="return-captcha"><label for="captcha"><?php echo $entry_captcha; ?></label>
                                    <input id="captcha" type="text" name="captcha" value="<?php echo $captcha; ?>" />
                                    <br />
                                    <img src="index.php?route=account/return/captcha" alt="" />
                                    <?php if ($error_captcha) { ?>
                                        <div class="error"><?php echo $error_captcha; ?></div>
                                    <?php } ?>
                                </div>
                            </div>
                        </div>
                    </li>
                </ul>
            </div>
        </div>
        <div class="buttons ui-grid-a">
            <div class="left ui-block-a"><a data-role="button" href="<?php echo $back; ?>" class="button"><span><?php echo $button_back; ?></span></a></div>
            <div class="right ui-block-b"><a data-role="button" data-theme="c" onclick="$('#return').submit();" class="button"><span><?php echo $button_continue; ?></span></a></div>
        </div>
    </form>
    <?php echo $content_bottom; ?>
</div>
<?php echo $footer; ?>